{extend name="mainadmin@layouts/base" /}
{block name="main" }
<header class="header  b-b clearfix">
     <div class="page-breadcrumbs">
            <ul class="breadcrumb" >
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>{$row['type_id']>0?'编缉':'添加'}优惠券</strong>
                </li>                                  
            </ul>
      
        <a class="pull-right pointer p-r" data-toggle="back" title="返回"><i class="fa fa-reply"></i></a>
     </div>
</header>
  
<section class="scrollable wrapper">

	<section class="panel panel-default">
		<form class="form-horizontal form-validate panel-body" method="post" action="{:url('info')}">
            <div class="form-group">
                <label class="col-sm-2 control-label">优惠券名称：</label>
                <div class="col-sm-5 must">
                    <input type="text" class="input-max" data-rule-required="true" name="type_name" value="{$row.type_name}" data-rule-maxlength="25" />
                </div>
            </div>

            <div class="line line-dashed line-lg pull-in"></div>
             <div class="form-group">
                <label class="col-sm-2 control-label">优惠券面额：</label>
                <div class="col-sm-1 must">
                    <input type="text" class="input-max" data-rule-required="true" name="type_money" value="{$row.type_money}" data-rule-maxlength="15" />
                </div>
            </div>
          
            <div class="line line-dashed line-lg pull-in"></div>
             <div class="form-group">
                <label class="col-sm-2 control-label">消费金额：</label>
                <div class="col-sm-1 must">
                    <input type="text" class="input-max" data-rule-required="true" name="min_amount" value="{$row.min_amount}" data-rule-maxlength="15" />
                </div>
            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">发放类型：</label>
                <div class="col-sm-10">
                {if condition="$row.type_id > 0"}
                	 <label>{$SendType[$row['send_type']]['name']}</label>
                {else/}
                    {volist name="SendType" id="st" }
                       <label>
                            <input name="send_type" value="{$st.dict_key}" class="js_inventory" type="radio" {$row['send_type']==$st['dict_key']?'checked':''}> {$st.dict_val}
                        </label>
                     {/volist}     
               	 {/if}                        
                </div>
               
            </div>
        <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">发放起始日期：</label>
                <div class="col-sm-2">
                   <div class="input-group"> <input type="text" class="input-max" name="send_start_date" id="send_start_date" value="{$row.send_start_date|dateTpl='',true}" readonly="readonly"   data-before="#send_end_date" data-toggle="datetimepicker"  data-position="top-right" /><span class="input-group-addon"><i class="fa fa-calendar"></i></span></div>
                </div>
               
            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">发放结束日期：</label>
                <div class="col-sm-2">
                   <div class="input-group"> <input name="send_end_date" type="text" class="input-max" id="send_end_date" value="{$row.send_end_date|dateTpl='',true}" readonly="readonly"   data-after="#send_start_date" data-toggle="datetimepicker" data-position="top-right"  /><span class="input-group-addon"><i class="fa fa-calendar"></i></span></div> 
                </div> <label>只有当前时间介于起始日期和截止日期之间时，此类型的红包才可以发放</label>
            </div>
             <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">使用起始日期：</label>
                <div class="col-sm-2">
                   <div class="input-group"> <input type="text" class="input-max" name="use_start_date"  id="use_start_date"  value="{$row.use_start_date|dateTpl='',true}" readonly="readonly"   data-before="#use_end_date"  data-toggle="datetimepicker" data-position="top-right" data-startdate="now"/><span class="input-group-addon"><i class="fa fa-calendar"></i></span></div> 
                </div>
            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-2 control-label">使用结束日期：</label>
                <div class="col-sm-2">
                   <div class="input-group"> <input type="text" class="input-max" name="use_end_date" id="use_end_date" value="{$row.use_end_date|dateTpl='',true}"  readonly="readonly" data-after="#use_start_date"  data-toggle="datetimepicker" data-position="top-right"/><span class="input-group-addon"><i class="fa fa-calendar"></i></span></div> 
                </div><label>只有当前时间介于起始日期和截止日期之间时，此类型的优惠券才可以使用</label>
            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2 m-t"> <input name="type_id" type="hidden" value="{$row.type_id|intval}">
                      <button type="submit" class="btn btn-primary" data-loading-text="保存中...">保存</button>
                      <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                </div>
        	</div>
       </form>     
	</section>
</section>
{/block}
